﻿using Newtonsoft.Json;
using System.Xml.Serialization;

namespace MiniFox.Platform
{
    /// <summary>
    /// 系统帐户身份(可通过oauth2认证返回)
    /// </summary>
    [Serializable, JsonObject]
    public class OpenAuthIdentity : SystemIdentity
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="globalId"></param>
        public OpenAuthIdentity(string globalId) : base(globalId)
        {
        }
        /// <summary>
        /// 安全邮箱(由于隐私问题，不可序列化及反序列化)
        /// </summary>
        [JsonProperty("secEmail")]
        public virtual string SecEmail
        {
            get;
            set;
        }
        /// <summary>
        /// 注册手机号(由于隐私问题，不可序列化及反序列化)
        /// </summary>
        [JsonProperty("cellphone")]
        public virtual string Cellphone
        {
            get;
            set;
        }
        /// <summary>
        /// 头像地址
        /// </summary>
        [JsonProperty("icon")]
        public string Icon
        {
            get;
            set;
        }
        /// <summary>
        /// 是否为超级管理员
        /// </summary>
        public bool IsAdministrator
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        [JsonIgnore, XmlIgnore]
        public override string AuthenticationType
        {
            get
            {
                return "MiniFox.SysUser";
            }
        }
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("status")]
        public IdentityStatus Status
        {
            get;
            set;
        }
    }

}
